<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>注册页面</title>
	<script type="text/javascript" src="js/jquery-1.4.3.js"></script>
	<script type="text/javascript">
		function check_name() {
			$.ajax({
				"url" : "/ajax02/checkName.do",
				"tape" : "post",
				// "data" : "name=" + $("#username").val()+"&age=100",
				"data" : {name : $("#username").val() , age : 99},
				"dataType" : "text",
				"success" : function(data) {
					$("#info").html(data);
				}
			});
		}
		
		$(function() {
			$("#username").blur(check_name);
		});
		
	</script>
</head>
<body>
	<h2>Hello Ajax</h2>
	<form>
		用户名：<input type="text" id="username" name="username" />
		<span id="info"></span>
		<br />
		密&nbsp;&nbsp;&nbsp;码：<input type="password" id="password" name="password" />
		<br />
		<input type="submit" value="注册" />
	</form> 
</body>
</html>